from flask import Flask, render_template,request,jsonify
import chat



app = Flask(__name__,template_folder='../templates')

@app.route('/chat')
def index():
    return render_template('index.html')


@app.route("/chat/reqMsg",methods=['POST'])
def chatapi():
    msg=request.get_json()['msg']
    print(msg)
    result=chat.main(msg)
    return jsonify({'msg': result})
    


if __name__ == '__main__':
    app.run(host='0.0.0.0',port=9000)

# nohup python3 -u flash-res.py >163flask.log 2>&1 &
